package behaviorpattern.memento.demo1;

public class GameRole {
	private int vit;
	private int atk;
	private int def;
	
	public RoleStateMemento saveState() {
		return new RoleStateMemento(vit, atk, def);
	}
	
	public void recoveryState(RoleStateMemento memento) {
		this.vit = memento.getVit();
		this.atk = memento.getAtk();
		this.def = memento.getDef();
	}
	
	public void initialState() {
		vit = 100;
		atk = 100;
		def = 100;
	}
	
	public void fight() {
		vit = 0;
		atk = 0;
		def = 0;
	}
	
	public void stateDisplay() {
		System.out.println("vit = " + vit + ", atk = " + atk + ", def = " + def);
	}
}
